Jetfire Code: Meetings and Tasks

Modified on 2010/01/19 21:50 by John — Categorized as: Jetfire Code


Jetfire Code: Meetings and Tasks

The Jetfire Code Class for Meetings and Tasks is shown below in the box. This class is used for Appointments, Meetings and Tasks.

// Meeting Workflow
//===================================================================================
// MeetingTaskChildWorkflows.txt
//===================================================================================
// Copyright (C) 2007 TrackerRealm Corporation
// This file is part of Jetfire.
// 
// Jetfire is open software: you can redistribute it and/or modify it under the terms
// of the GNU General Public License as published by the Free Software Foundation, 
// version 3 of the License.
// 
// Jetfire is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
// PURPOSE.  See the GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License along with Jetfire.
// If not, see http://www.gnu.org/licenses.
// REMOVAL OF THIS NOTICE IS VIOLATION OF THE COPYRIGHT.
//===================================================================================
namespace JetfireApps
{
	public workflow Appointment : FormalWorkflow
	{
		// C O N S T R U C T O R - Instantiate the Appointment
		// The Appointment starts in the Start State.
		public Appointment()
		{
			TypeOfWork = TypeOfWork.Appointment;
			Subject = "Appointment";
			enterstate Start();
		}
		// P R O P E R T I E S
		// Appointment wraps the Formal Workflow, which contains a number of properties and methods
		// S T A T E   M E T H O D S
		// State Transition        Command       Comment
		// New -> Start            new           The workflow enters the start state when instantiated
		// Start -> Scheduled      Schedule
		// Scheduled -> Start      UnSchedule    The user un-scheduled the appointment
		// Scheduled -> Scheduled  Schedule      The user rescheduled the appointment
		// Start -> Cancelled      Cancel
		// Scheduled -> Cancelled  Cancel        This is an end state
		// Scheduled -> Finished   Complete      This is an end state
		//
		public Start()
		{
		}
		public Scheduled()
		{
		}
		public Cancelled()
		{
		}
		public Finished()
		{
		}
		// C O M M A N D S
		// The Schedule command can be used in the Start and Scheduled states
		public void Start_Now_Task() : states(Start)
		{
			StartDateTime = DateTime.Now;
			enterstate Scheduled();
		}
		public void Complete_Now_Task() : states(Scheduled)
		{
			EndDateTime = DateTime.Now;
			enterstate Finished();
		}
		public void Schedule() : states(Start, Scheduled)
		{
			StartDateTime = DateTime.Today;
			enterstate Scheduled();
		}
		// The Unschedule command can be used in the Scheduled states by the Organizer
		public void Unschedule() : states(Scheduled)
		{
			StartDateTime = DateTime.NoDateOrTime;
			EndDateTime = DateTime.NoDateOrTime;
			enterstate Start();
		}
		// The Cancel command can be used in the Start and Scheduled states by the Organizer
		public void Cancel() : states(Start, Scheduled)
		{
			enterstate Cancelled();
		}
		// The Complete command can be used in the Scheduled state
		public void Complete() : states(Scheduled)
		{
			enterstate Finished();
		}
	}
	// Meeting inherits from Appointment.  The basic difference is attendees.
	public workflow Meeting : Appointment
	{
		public Meeting()
		{
			Attendees = new List();
			Attendees.Subject = "Workers List";
			TypeOfWork = TypeOfWork.Meeting;
			Subject = "Meeting";
			enterstate Start();
		}
		// Properties
		public List Attendees
		{ 
			get;
			private set;
		}
		// State Methods - same as Appointment
		// Commands - same as Appointment
	}
	// Task inherits from Meeting.  It also accomodates a list of workers.
	public workflow Task : Meeting
	{
		public Task()
		{
			TypeOfWork = TypeOfWork.Task;
			Subject = "Task";
			enterstate Start();
		}
		// Properties
		public List Workers
		{ 
			get { return Attendees;   }
		}
		// State Methods - same as Appointment
		// Commands - same as Appointment
	}
}

See Also

Jetfire Code Library
Jetfire Code Application Library